﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
body,table {
	font-family: 微软雅黑;
	font-size: 10pt
}

table {
	border-collapse: collapse;
	border: 1px solid gray;
	border-width: 2px 1px 2px 1px;
}

th {
	border: 1px solid gray;
	padding: 4px;
	background-color: #ddd;
}

td {
	border: 1px solid gray;
	padding: 4px;
}

tr:nth-child(2n) {
	background-color: #f8f8f8;
}

pre {
	border: 2px solid #d6d6d6;
	padding: 0px;
	border-radius: 3px;
}
</style>
</head>
<body>
	<div>
		<h3
			style="margin: 15px 0px 0px; padding: 0px; font-size: 16.32px; font-weight: normal; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;">Selector选择器概述
		</h3>
		<ul
			style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-style: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">
			<li
				style="font-weight: 400; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;"><span
				style="color: rgb(25, 41, 67); font-family: Consolas, monospace; line-height: 13px;">一个HTML元素通常由:
					标签名 , ID , class , 属性键值对 这四类组成; 如下图:&nbsp;</span><span
				style="color: rgb(25, 41, 67); font-family: Consolas, monospace; line-height: 13px;">&nbsp;</span>
			</li>
			<li
				style="font-weight: 400; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;"><img
				src="" />
			</li>
			<li
				style="font-weight: 400; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
				<code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					tagname</code>: 通过标签查找元素，比如： <code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					a &nbsp;</code>
			</li>
			<li
				style="color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
				<code
					style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




					#id</code>: 通过ID查找元素，比如： <code
					style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




					#s_top_wrap &nbsp;</code> <code
					style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">

					<b> 注意: #不能和@一起使用;</b>
				</code>
			</li>
			<li
				style="font-weight: 400; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
				<code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					.class</code>: 通过class名称查找元素，比如： <code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					.</code><span
				style="color: rgb(34, 34, 34); font-family: Consolas, 'Lucida Console', 'Courier New', monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">s-top-wrap
					s-down</span>
			</li>
			<li
				style="font-weight: 400; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
				<code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					[attribute]</code>: 利用属性查找元素，比如： <code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					[style]</code>
			</li>
			<li
				style="font-weight: 400; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
				<code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					[^attr]</code>: 利用属性名前缀来查找元素，比如：可以用 <code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					[^data-]</code><span>&nbsp;</span>来查找带有HTML5 Dataset属性的元素
			</li>
			<li
				style="font-weight: 400; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
				<code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					[attr=value]</code>: 利用属性值来查找元素，比如： <code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					[width=500]</code>
			</li>
			<li
				style="font-weight: 400; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
				<code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					[attr^=value]</code>,<span>&nbsp;</span> <code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					[attr$=value]</code>,<span>&nbsp;</span> <code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					[attr*=value]</code>: 利用匹配属性值开头、结尾或包含属性值来查找元素，比如： <code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					[href*=/path/]</code>
			</li>
			<li
				style="font-weight: 400; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
				<code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					[attr~=regex]</code>: 利用属性值匹配正则表达式来查找元素，比如：<span>&nbsp;</span> <code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					img[src~=(?i)\.(png|jpe?g)]</code>
			</li>
			<li
				style="font-weight: 400; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
				<code
					style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">




					*</code>: 这个符号将匹配所有元素
			</li>
		</ul>
		<h3
			style="margin-top: 15px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16.32px; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-style: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">
			<span style="font-family: 微软雅黑; font-size: 13px;">
				<h3
					style="margin-top: 15px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16.32px; font-weight: normal; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-style: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">特殊选择器@
				</h3>
				<ul
					style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(25, 41, 67); font-style: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">
					<li
						style="font-weight: 400; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;"><span
						style="font-family: Consolas, monospace; line-height: 13px;">@n
							:表示:只选择第n个符合条件的,;</span></li>
					<li
						style="font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">注意：这里的n最小是1;
						&nbsp;@前后不要有空格 ; 如果没有@,且抓取规则匹配多个的话,默认返回第一个; #不能和@一起使用;</li>
				</ul>
			</span>
		</h3>
		<div style="text-align: left;">
			<h3
				style="margin-top: 15px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: normal; font-style: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">
			</h3>
			<h3
				style="margin-top: 15px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16.32px; font-weight: normal; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-style: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">Selector选择器组合使用
			</h3>
			<ul
				style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(25, 41, 67); font-style: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">
				<li
					style="font-weight: 400; font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
					<code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						el#id</code>: 元素+ID，比如：<span>&nbsp;</span> <code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						div#logo</code>
				</li>
				<li
					style="font-weight: 400; font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
					<code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						el.class</code>: 元素+class，比如：<span>&nbsp;</span> <code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						div.masthead</code>
				</li>
				<li
					style="font-weight: 400; font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
					<code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						el[attr]</code>: 元素+attr，比如：<span>&nbsp;</span> <code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						a[href]</code>
				</li>
				<li
					style="font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
					<code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						<code
							style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">&nbsp;el[attr]@2&nbsp;</code>
						:元素+attr+@ : 比如:&nbsp;a[href='http://www.baidu.com']@2 &nbsp;表示:
						从所有带href属性,且属性值='http://www.baidu.com'的a标签的集合中选取第二个,如果符合这样条件的a标签的总个数不到2个,则选取结果为空&nbsp;;
					</code> <code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">


						<b>[注意: @前后不要有空格]</b>
					</code>
				</li>
				<li
					style="font-weight: 400; font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">任意组合，比如：
					<code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						a[href].highlight</code>
				</li>
				<li
					style="font-weight: 400; font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
					<code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						ancestor child</code>: 查找某个元素下子元素，比如：可以用 <code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						.body p</code><span>&nbsp;</span>查找在&quot;body&quot;元素下的所有<span>&nbsp;</span>
					<code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						p</code>元素
				</li>
				<li
					style="font-weight: 400; font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
					<code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						parent &gt; child</code>: 查找某个父元素下的直接子元素，比如：可以用 <code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						div.content &gt; p</code><span>&nbsp;</span>查找<span>&nbsp;</span> <code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						p</code><span>&nbsp;</span>元素，也可以用 <code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						body &gt; *</code><span>&nbsp;</span>查找body标签下所有直接子元素
				</li>
				<li
					style="font-weight: 400; font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
					<code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						siblingA + siblingB</code>: 查找在A元素之前第一个同级元素B，比如： <code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						div.head + div</code>
				</li>
				<li
					style="font-weight: 400; font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
					<code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						siblingA ~ siblingX</code>: 查找A元素之前的同级X元素，比如： <code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						h1 ~ p</code>
				</li>
				<li
					style="font-weight: 400; font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; margin-top: 0px; margin-right: 0px; margin-bottom: 8px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial;">
					<code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						el, el, el</code>:多个选择器组合，查找匹配任一选择器的任一元素，例如： <code
						style="margin-top: 0px; margin-right: -1px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px;">




						div.masthead, div.logo</code>
				</li>
			</ul>
			<div>
				<span
					style="color: #192943; font-family: 'helvetica neue', arial, clean, sans-serif"><span
					style="font-size: 14px;">
						<h3
							style="margin: 15px 0px 0px; padding: 0px; font-size: 16.32px; font-weight: normal; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;">伪选择器selectors
						</h3>
						<ul
							style="margin: 0px; padding: 0px; color: rgb(25, 41, 67); font-family: 'helvetica neue', arial, clean, sans-serif; font-size: 13.6px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;">
							<li
								style="margin: 0px 0px 8px 20px; padding: 0px; list-style: disc;">
								<code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									:lt(n)</code>: 查找哪些元素的同级索引值（它的位置在DOM树中是相对于它的父节点）小于n，比如： <code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									td:lt(3)</code><span>&nbsp;</span>表示小于三列的元素
							</li>
							<li
								style="margin: 0px 0px 8px 20px; padding: 0px; list-style: disc;">
								<code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									:gt(n)</code>:查找哪些元素的同级索引值大于 <code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									n</code> <code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									，比如</code>：<span>&nbsp;</span> <code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									div p:gt(2)</code>表示哪些div中有包含2个以上的p元素
							</li>
							<li
								style="margin: 0px 0px 8px 20px; padding: 0px; list-style: disc;">
								<code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									:eq(n)</code>: 查找哪些元素的同级索引值与 <code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									n</code>相等，比如： <code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									form input:eq(1)</code>表示包含一个input标签的Form元素
							</li>
							<li
								style="margin: 0px 0px 8px 20px; padding: 0px; list-style: disc;">
								<code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									:has(seletor)</code>: 查找匹配选择器包含元素的元素，比如： <code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									div:has(p)</code>表示哪些div包含了p元素
							</li>
							<li
								style="margin: 0px 0px 8px 20px; padding: 0px; list-style: disc;">
								<code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									:not(selector)</code>: 查找与选择器不匹配的元素，比如：<span>&nbsp;</span> <code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									div:not(.logo)</code><span>&nbsp;</span>表示不包含 class=logo 元素的所有 div 列表
							</li>
							<li
								style="margin: 0px 0px 8px 20px; padding: 0px; list-style: disc;">
								<code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									:contains(text)</code>: 查找包含给定文本的元素，搜索不区分大不写，比如：<span>&nbsp;</span> <code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									p:contains(jsoup)</code>
							</li>
							<li
								style="margin: 0px 0px 8px 20px; padding: 0px; list-style: disc;">
								<code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									:containsOwn(text)</code>: 查找直接包含给定文本的元素
							</li>
							<li
								style="margin: 0px 0px 8px 20px; padding: 0px; list-style: disc;">
								<code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									:matches(regex)</code>: 查找哪些元素的文本匹配指定的正则表达式，比如： <code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									div:matches((?i)login)</code>
							</li>
							<li
								style="margin: 0px 0px 8px 20px; padding: 0px; list-style: disc;">
								<code
									style="margin: 0px -1px; padding: 0px 2px; font-style: inherit; font-weight: inherit; font-family: Consolas, monospace; font-size: 13px; line-height: 13px; background-color: rgb(231, 235, 242); border-radius: 4px;">


									:matchesOwn(regex)</code>: 查找自身包含文本匹配指定正则表达式的元素
							</li>
							<li
								style="margin: 0px 0px 8px 20px; padding: 0px; list-style: disc;">注意：上述伪选择器索引是从0开始的，也就是说第一个元素索引值为0，第二个元素index为1等
							</li>
						</ul>
				</span></span>
			</div>
			</span>下面是抓取实例: </span>
			<br/>
			</span> 抓取的地址是:  http://www.runoob.com/java/java-environment-setup.html</span>
			<br/>
			</span>你可以到这个页面上按照图示的方式,进行测试验证. </span>
			<div>
				<span
					style="color: #192943; font-family: 'helvetica neue', arial, clean, sans-serif"><span
					style="font-size: 14px;"><br /></span></span>
			</div>
			<div>
				<span
					style="color: #192943; font-family: 'helvetica neue', arial, clean, sans-serif"><span
					style="font-size: 14px;"><img
						src="" /></span></span>
			</div>
			<div>
				<span
					style="color: #192943; font-family: 'helvetica neue', arial, clean, sans-serif"><span
					style="font-size: 14px;"><br /></span></span>
			</div>
			<div>
				<span
					style="color: #192943; font-family: 'helvetica neue', arial, clean, sans-serif"><span
					style="font-size: 14px;"><br /></span></span>
			</div>
			<div>
				<span
					style="color: #192943; font-family: 'helvetica neue', arial, clean, sans-serif"><span
					style="font-size: 14px;"><br /></span></span>
			</div>
			<div>
				<span
					style="color: #192943; font-family: 'helvetica neue', arial, clean, sans-serif"><span
					style="font-size: 14px;"><br /></span></span>
			</div>
			<div>
				<span
					style="color: #192943; font-family: 'helvetica neue', arial, clean, sans-serif"><span
					style="font-size: 14px;"><br /></span></span>
			</div>
		</div>
	</div>
</body>
</html>